home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr43 / ppl4p10.zip / SCRIPTS.DOC < prev    next >
Text File  |  1995-02-12  |  23KB  |  953 lines

  1.  
  2.  
  3.  
  4.                     BUILDER (Script Compiler)
  5.  
  6.                  For the Personal Protocol Library
  7.  
  8.  
  9.                           USERS MANUAL
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                            Version 2.0
  16.  
  17.                         February 12, 1995
  18.  
  19.  
  20.  
  21.  
  22.                  This software is provided as-is.
  23.           There are no warranties, expressed or implied.
  24.  
  25.  
  26.  
  27.  
  28.                        Copyright (C) 1995
  29.                        All rights reserved
  30.  
  31.  
  32.  
  33.                        MarshallSoft Computing, Inc.
  34.                        Post Office Box 4543
  35.                        Huntsville AL 35815
  36.  
  37.                        Voice 205-881-4630
  38.                        FAX   205|880|0925
  39.                        BBS   205-880-9748
  40.  
  41.  
  42.  
  43.  
  44.                               _______
  45.                          ____|__     |                (R)
  46.                       --+       |    +-------------------
  47.                         |   ____|__  |  Association of
  48.                         |  |       |_|  Shareware
  49.                         |__|   o   |    Professionals
  50.                       --+--+   |   +---------------------
  51.                            |___|___|    MEMBER
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  SCRIPTS Users Manual                                              Page 1
  69.                        C O N T E N T S
  70.  
  71.  
  72.  
  73.  
  74.  
  75.   Chapter                                                      Page
  76.  
  77.   1.0 Introduction................................................3
  78.       1.1  Running BUILDER........................................3
  79.       1.2  Script Language........................................4
  80.   2.0 Architecture................................................5
  81.   3.0 Script Instructions.........................................6
  82.       3.1  Pseudo Instruction.....................................6
  83.       3.2  Instruction Set........................................6
  84.            3.2.1  ACCEPT..........................................6
  85.            3.2.2  BAUD............................................6
  86.            3.2.3  CALL............................................7
  87.            3.2.4  DATABITS........................................7
  88.            3.3.5  DEBUG...........................................7
  89.            3.2.6  DELAY...........................................7
  90.            3.2.7  GOTO............................................7
  91.            3.2.8  HALT............................................7
  92.            3.2.9  HANGUP..........................................7
  93.            3.2.10 IF..............................................8
  94.            3.2.11 IFFALSE.........................................8
  95.            3.2.12 IFTRUE..........................................8
  96.            3.2.13 IFNOT...........................................8
  97.            3.2.14 LOOP............................................8
  98.            3.2.15 NOP.............................................8
  99.            3.2.16 PARITY..........................................9
  100.            3.2.17 PROTOCOL........................................9
  101.            3.2.18 QUIET...........................................9
  102.            3.2.19 RECEIVE.........................................9
  103.            3.2.20 REPLY...........................................9
  104.            3.2.21 RETURN..........................................9
  105.            3.2.22 SAY............................................10
  106.            3.2.23 SEND...........................................10
  107.            3.2.24 SETCASE........................................10
  108.            3.2.25 SETCOUNT.......................................10
  109.            3.2.26 SETPACE........................................10
  110.            3.2.27 SETWAIT........................................10
  111.            3.2.28 STATUS.........................................10
  112.            3.2.29 STOPBITS.......................................11
  113.            3.2.30 TEST...........................................11
  114.            3.2.31 USER...........................................11
  115.            3.2.32 WAITFOR........................................11
  116.   4.0 Example Script.............................................12
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  SCRIPTS Users Manual                                              Page 2
  137.   1.0 Introduction
  138.  
  139.   SCRIPT is a simple and easy to use  script  language.   It  is  meant  as  a
  140.   straight  forward  way  to  automate  calling  a  BBS and similar jobs.  The
  141.   program BUILDER compiles script source files and  creates  script  binaries,
  142.   which  can then be executed by the script interpreter SI (or WSI), which can
  143.   be linked with your application. The TERM example application can run script
  144.   files.
  145.  
  146.   Several example SCRIPT programs are included:
  147.  
  148.         LOGIN.SS      Logs onto our support BBS as GUEST.
  149.  
  150.         GET_BUGS.SS   Logs onto our support BBS as  GUEST  and  downloads  the
  151.                       BUGS.DOC file.
  152.  
  153.         GET_MAIL.SS   Logs onto our support BBS as  GUEST  and  downloads  any
  154.                       new mail addressed to GUEST.
  155.  
  156.   1.1 Running BUILDER
  157.  
  158.   The BUILDER executable program is not SHAREWARE, but rather is software that
  159.   is  part  of  the  Personal Protocol Library shareware registration package.
  160.   BUILDER is only available to registered users of the Personal Communications
  161.   Library or Personal Protocol Library.
  162.  
  163.   To use BUILDER, first write your script using any text editor and  name  the
  164.   file with an extension of ".SS". Compile by typing
  165.  
  166.        BUILDER <filename>
  167.  
  168.   where  <filename>  is  specified  without the ".SS" extension. A listing can
  169.   also be displayed by typing
  170.  
  171.        BUILDER -l <filename>
  172.  
  173.   An unassembly of the generated script binary can be selected by typing:
  174.  
  175.        BUILDER -u <filename>
  176.  
  177.   A detailed debug compilation listing can be selected by typing:
  178.  
  179.        BUILDER -d <filename>
  180.  
  181.   For  example, to compile the example script LOGIN.SS with both a listing and
  182.   an unassembly, type:
  183.  
  184.        BUILDER -lu LOGIN
  185.  
  186.   The script interpreter (SI or WSI) calls functions in the  MODEM_IO.C  file.
  187.   To  enable  script  interpretation, define SCRIPTS as 1 in the TERM.CFG (for
  188.   PPL4C), DEFINES.PAS (for PPL4P), DEFINES.BAS (for PPL4PB),  or  TERM.H  file
  189.   (for PPL4W).
  190.  
  191.   BUILDER reads the  script  source  file  with  an  extention  of  ".SS"  and
  192.   generates a script binary file with an extention of ".SB".
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  SCRIPTS Users Manual                                              Page 3
  205.   1.2 Script Language
  206.  
  207.   Use  any  text  editor  to  prepare  a script source file.  A script program
  208.   consists of one or more lines, each line containing either a comment  (lines
  209.   starting  with  a  '#'),  or an instruction. An instruction will have either
  210.   zero or one operand. The optional label precedes the  instruction  and  ends
  211.   with  a colon. Labels and symbols may be up to 50 characters in length. Data
  212.   operands should be delimited by double quote (") characters.  For example:
  213.  
  214.        # send Control-X 5 times
  215.           SAY      "Sending Control-X 5 times"
  216.           SETCOUNT  5
  217.        AGAIN:
  218.           REPLY     "^X"
  219.           LOOP      AGAIN
  220.  
  221.   The basic syntax of SCRIPT is
  222.  
  223.       {label:} opcode {operand}
  224.  
  225.   where label is optional except for storage or string operations, and operand
  226.   depends on the  particular  instruction.  Some  instructions  such  as  CALL
  227.   require no operand while others such as ACCEPT require a single operand.
  228.  
  229.   Two  instructions  IF  and IFNOT can make use of the keyword THEN:
  230.  
  231.       {<label1>:} IF <string> THEN <label2>
  232.  
  233.   and
  234.  
  235.       {<label1>:} IFNOT <string> THEN <label2>
  236.  
  237.   All time values are specified in terms of decimal seconds.  Refer to  QUIET,
  238.   WAITFOR, DELAY, and SETPACE.
  239.  
  240.   Labels must end with a colon and be separated from the following instruction
  241.   by one or more blanks.
  242.  
  243.   The END statement is optional and terminates script translation even  though
  244.   more instructions may follow.
  245.  
  246.   Control characters may be sent by use of the ^ notation where ^A is  1  hex,
  247.   ^B  is  2 hex, etc. In particular, a carriage return (CR) is a ^M and a line
  248.   feed (LF) is a ^J.  In the REPLY instruction (sending a string to the serial
  249.   port), exclamation marks "!" are replaced with carriage returns.
  250.  
  251.   Scripts are very easy to write.  Refer to the  example  script  segments  in
  252.   Section 3 and the example script in section 4.
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  SCRIPTS Users Manual                                              Page 4
  273.   2.0 Architecture
  274.  
  275.   The SCRIPT compiler BUILDER translates the source script language into a set
  276.   of instructions and storage for a virtual computer,  which  the  SI  routine
  277.   executes by interpretation.
  278.  
  279.   The  primary  consideration in designing the virtual machine architecture is
  280.   that it should  be  fast  and  easy  for  the  script  interpreter  (SI)  to
  281.   interpret.   For  this  reason, a large or complex instruction set was ruled
  282.   out. A secondary consideration  is  that  the  virtual  language  should  be
  283.   exceedingly easy to program given the simple instruction set.
  284.  
  285.   The  virtual  machine consists of a byte addressable code area of 1024 bytes
  286.   and a byte  addressable  data  area  of  1024  bytes.  The  virtual  machine
  287.   instructions  generated  by  BUILDER  are  stored in the code area while the
  288.   string and storage data is stored in the data area.
  289.  
  290.   There  are  two classes of instructions: those that allocate storage (STRING
  291.   and  STORAGE)  and  executable  instructions.  There   are   41   executable
  292.   instructions in the script language.
  293.  
  294.   There  are  three  types of instructions: Those that reference the code area
  295.   such as GOTO, those that reference the data area such as ACCEPT,  and  those
  296.   that reference neither such as NOP.
  297.  
  298.   Every  instruction  that  references  the data area sets the "Program Status
  299.   Character" (PSC) to the first character of the string. A NULL (0 hex) is set
  300.   for empty (NULL) strings.
  301.  
  302.   The PSC is tested against when doing branch instructions.
  303.  
  304.       IFTRUE  <label>           ++jumps to <label> if the PSC is not 0
  305.       IFFALSE <label>           ++jumps to <label> if the PSC is 0
  306.       IF <char> THEN <label>    ++jumps to <label> if PSC = <char>
  307.       IFNOT <char> THEN <label> ++jumps to <label> if PSC != <char>
  308.  
  309.  
  310.   For example:
  311.  
  312.       WAITFOR   "R)un Q)uit"
  313.       IFFALSE   TIMED_OUT
  314.       IF "0"    GOT_RUN
  315.       IF "1"    GOT_QUIT
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  SCRIPTS Users Manual                                              Page 5
  341.   3.0 Script Instructions
  342.  
  343.   3.1 Pseudo Instructions
  344.  
  345.   There  are  two  classes  of  SCRIPT instructions. The first consists of two
  346.   (pseudo) instructions STRING and STORAGE. They allocate storage in the  data
  347.   area but generate no instructions.
  348.  
  349.   3.1.1 STRING
  350.  
  351.   The STRING pseudo instruction stores a string in the data memory.
  352.  
  353.   <label>: STRING  "<string>"
  354.  
  355.   Example:
  356.  
  357.       FILENAME: STRING "MSC_Z.SS"
  358.  
  359.   3.1.2 STORAGE
  360.  
  361.   The  STORAGE  pseudo  instruction allocates a range of memory and sets it to
  362.   zeros (NULLs).
  363.  
  364.   <label>: STORAGE  <size>
  365.  
  366.   Example:
  367.  
  368.       FILENAME: STORAGE  15
  369.  
  370.   3.2 Instruction Set
  371.  
  372.   The following are the script instructions. Each instruction  either  has  no
  373.   argument or a single argument, which is either a data reference (such as SAY
  374.   or REPLY) or a code reference (such as GOTO).
  375.  
  376.   3.2.1 ACCEPT
  377.  
  378.   The ACCEPT instruction accepts a text string from the keyboard.
  379.  
  380.        FILENAME:   STORAGE    15
  381.                    ...
  382.                    ACCEPT     FILENAME
  383.  
  384.   Be  sure  that  you  have allocated sufficient storage to accept whatever is
  385.   typed in. ACCEPT can also read into a STRING. The PSC is set to the 1st byte
  386.   of the typed in string.
  387.  
  388.   3.2.2 BAUD
  389.  
  390.   The BAUD instruction sets the baud rate (300 to 115200 baud).  The  argument
  391.   is the baud rate.
  392.  
  393.        BAUD 38400
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  SCRIPTS Users Manual                                              Page 6
  409.   3.2.3 CALL
  410.  
  411.   The CALL instruction calls a script subroutine, which then returns using the
  412.   RETURN instruction. The argument is a program label.
  413.  
  414.        CALL <my_sub>
  415.  
  416.   The call stack can accomodate up to 32 subroutine levels.
  417.  
  418.   3.2.4 DATABITS
  419.  
  420.   The  DATABITS  instruction  sets  the  number  of  data  bits to 7 or 8. The
  421.   argument is the number of data bits.
  422.  
  423.        DATABITS 7
  424.  
  425.   3.2.5 DEBUG
  426.  
  427.   The DEBUG instruction turns on certain debugging information. It should only
  428.   be used to provide additional information when reporting a bug.
  429.  
  430.   3.2.6 DELAY
  431.  
  432.   The DELAY instuction delays a specified amount of time.  The argument is the
  433.   delay time in (decimal) seconds.
  434.  
  435.        DELAY 5.0
  436.  
  437.   3.2.7 GOTO
  438.  
  439.   The  GOTO  instruction  unconditionally  branches. The argument is a program
  440.   label.
  441.  
  442.        GOTO END
  443.  
  444.   3.2.8 HALT
  445.  
  446.   The  HALT  instruction halts (terminates) the script interpreter and returns
  447.   to the calling program. There is no argument.
  448.  
  449.        HALT
  450.  
  451.   3.2.9 HANGUP
  452.  
  453.   The HANGUP instruction hangs up the modem. There is no argument.
  454.  
  455.        HANGUP
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  SCRIPTS Users Manual                                              Page 7
  477.   3.2.10 IF
  478.  
  479.   The IF instruction branches if the PSC (Program Status Character)  is  equal
  480.   to the argument.
  481.  
  482.        WAITFOR    "more?|Main Menu:"
  483.        IF         "0"  THEN GOT_MORE
  484.        IF         "1"  THEN GOT_MENU
  485.  
  486.   The IF ... THEN syntax is really a short-hand for
  487.  
  488.        IF  "<char>"
  489.        GOTO <label>
  490.  
  491.   where  the GOTO following the IF is only executed if the PSC is equal to the
  492.   specified argument.
  493.  
  494.   3.2.11 IFFALSE
  495.  
  496.   The IF instruction branches if the PSC (Program Status Character)  is  equal
  497.   to zero (NULL).
  498.  
  499.        WAITFOR   "OK"
  500.        IFFALSE   ERROR
  501.  
  502.   3.2.12 IFNOT
  503.  
  504.   The  IF  instruction  branches  if the PSC (Program Status Character) is not
  505.   equal to the argument.
  506.  
  507.        WAITFOR    "more?|Main Menu:"
  508.        IF         "0"  THEN GOT_MORE
  509.        IFNOT      "1"  THEN ERROR_EXIT
  510.  
  511.  
  512.   3.2.13 IFTRUE
  513.  
  514.   The IF instruction branches if the PSC (Program  Status  Character)  is  not
  515.   zero (NULL).
  516.  
  517.        WAITFOR  "OK"
  518.        IFTRUE   GOT_OK
  519.  
  520.   3.2.14 LOOP
  521.  
  522.   The LOOP instruction decrements the loop counter (which can be  set  by  the
  523.   SETCOUNT instruction), and branches if the value is less than or equal to 0.
  524.  
  525.        # transmit control-X 5 times
  526.        SETCOUNT  5
  527.      AGAIN:
  528.        REPLY     "^X"
  529.        LOOP      AGAIN
  530.  
  531.   3.2.15 NOP
  532.  
  533.   The NOP instuction doesn't do anything. There is no argument.
  534.  
  535.        NOP
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  SCRIPTS Users Manual                                              Page 8
  545.   3.2.16 PARITY
  546.  
  547.   The PARITY instruction sets the parity to either None ("N"), Even  ("E")  or
  548.   Odd ("O"). Only the 1st character of the operand is significant.
  549.  
  550.        PARITY "N"
  551.  
  552.   3.2.17 PROTOCOL
  553.  
  554.   The PROTOCOL instruction sets the protocol  to  ASCII,  XMODEM,  YMODEM,  or
  555.   ZMODEM  for  use  by  subsequent SEND and RECEIVE instructions. Only the 1st
  556.   character of the operand is significant.
  557.  
  558.        PROTOCOL  "A"     # select ASCII protocol
  559.        PROTOCOL  "X"     # select XMODEM protocol
  560.        PROTOCOL  "Y"     # select YMODEM protocol
  561.        PROTOCOL  "Z"     # select ZMODEM protocol
  562.  
  563.   3.2.18 QUIET
  564.  
  565.   The  QUIET  instruction  waits  for a period of silence. The argument is the
  566.   quiet time in (decimal) seconds.
  567.  
  568.        # wait for 5 seconds of quiet
  569.        QUIET 5.0
  570.  
  571.   3.2.19 RECEIVE
  572.  
  573.   The RECEIVE instruction starts an ASCII, XMODEM, YMODEM, or  ZMODEM  receive
  574.   session  dependent  upon  the  setting  of  the  PROTOCOL  instruction.  The
  575.   argument is the filename. A dummy filename should be  specified  for  YMODEM
  576.   and ZMODEM receives.
  577.  
  578.        RECEIVE   "BUGS.DOC"
  579.  
  580.   3.2.20 REPLY
  581.  
  582.   The REPLY instruction sends a string  to  the  modem.  A  '!'  character  is
  583.   interpreted as a carriage return. The argument is the reply string.
  584.  
  585.        REPLY    "GUEST!"
  586.  
  587.   Any control character can be embedded in the REPLY string by  specifing  its
  588.   value  using  the  ^  notation.  Recalling that ^M is the same as a carriage
  589.   return, the above REPLY instruction could also be coded as:
  590.  
  591.        REPLY    "GUEST^M"
  592.  
  593.   3.2.21 RETURN
  594.  
  595.   The  RETURN  instruction  returns  from  a  script  subroutine.  There is no
  596.   argument.
  597.  
  598.        RETURN
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  SCRIPTS Users Manual                                              Page 9
  613.   3.2.22 SAY
  614.  
  615.   The  SAY  instruction  displays a string on the console. The argument is the
  616.   string to display.
  617.  
  618.        SAY    "All done^M^J"
  619.  
  620.   Recall that ^M denotes a carriage return and ^J denotes a line feed.
  621.  
  622.   3.2.23 SEND
  623.  
  624.   The SEND instruction starts an ASCII, XMODEM, YMODEM, or ZMODEM transmission
  625.   session.  The argument is the filename.
  626.  
  627.        SEND   MY_FILE
  628.  
  629.   3.2.24 SETCASE
  630.  
  631.   The  SETCASE  instruction  determines whether case is significant in WAITFOR
  632.   compares.  The default is TRUE (case sensitive). The argument is either  "T"
  633.   or "F". To turn off case sensitivity:
  634.  
  635.        SETCASE   "F"
  636.  
  637.   3.2.25 SETCOUNT
  638.  
  639.   The  SETCOUNT  instruction  sets the count variable which can be used by the
  640.   LOOP instruction. The argument is the count value.
  641.  
  642.        SETCOUNT  5
  643.  
  644.   3.2.26 SETPACE
  645.  
  646.   The SETPACE instruction sets the pace at which characters are sent by REPLY.
  647.   The default is 0.200 of a second. The argument is the pace time in (decimal)
  648.   seconds.
  649.  
  650.        SETPACE  0.200
  651.  
  652.   SETPACE does not apply to protocol transfers.
  653.  
  654.   3.2.27 SETWAIT
  655.  
  656.   The SETWAIT instruction sets the timeout time that the  WAITFOR  instruction
  657.   uses.  The default is 30 seconds. The argument is the wait time in (decimal)
  658.   seconds.
  659.  
  660.        SETWAIT 30.0
  661.  
  662.   3.2.28 STATUS
  663.  
  664.   The STATUS instruction displays the status of the script interpreter.  There
  665.   is no argument.
  666.  
  667.        STATUS
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  SCRIPTS Users Manual                                              Page 10
  681.   3.2.29 STOPBITS
  682.  
  683.   The STOPBITS instruction sets the number  of  stop  bits  to  1  or  3.2.  The
  684.   argument is the number of stop bits.
  685.  
  686.        STOPBITS 1
  687.  
  688.   3.2.30 TEST
  689.  
  690.   The  TEST  instruction  sets the Program Status Character (PSC) to the first
  691.   character of the data argument.
  692.  
  693.   FILENAME: STRING  "HELLO"
  694.             TEST    FILENAME    #sets PSC to "H"
  695.  
  696.   Note  that  TEST  will  set  the PSC to 0 (NULL) when used to test a STORAGE
  697.   location that hasn't been stored into.
  698.  
  699.   3.2.31 USER
  700.  
  701.   There are eight USER instructions named USER1, USER2, ..., USER8.  Each user
  702.   function   references  the  data  area.   The  functionality  of  each  user
  703.   instruction must be programmed into the SI (or WSI)  script  interpreter  by
  704.   the programmer.
  705.  
  706.   3.2.32 WAITFOR
  707.  
  708.   The WAITFOR instruction waits (up to the number of seconds specified by  the
  709.   SETWAIT  instruction) for a specified string coming in over the serial line.
  710.   It then sets the Program Status Character (PSC) as follows:  If  the  string
  711.   was not found, the PSC is set to zero (NULL).  If it was found, then the PSC
  712.   is  set  to "0" for the first (or only) sub-string, "1" for the second, etc.
  713.   Substrings are separated by the "|" character.
  714.  
  715.   For example:
  716.  
  717.        WAITFOR  "MIKE|PAM|LAUREN"
  718.        IFFALSE  TIMED_OUT
  719.        IF  "0"  THEN GOT_MIKE
  720.        IF  "1"  THEN GOT_PAM
  721.        IF  "2"  THEN GOT_LAUREN
  722.  
  723.   Don't follow the last sub-string with a "|".
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  SCRIPTS Users Manual                                              Page 11
  749.   4.0 Example Script
  750.  
  751.   The following script logs on as GUEST and downloads BUGS.DOC from library  5
  752.   of  our  user support BBS. Note that the GUEST account has ZMODEM set as the
  753.   default protocol. When modifying this script for your own account,  be  sure
  754.   to  specify  a  default  protocol  and change the PROTOCOL variable below to
  755.   match. Choose either XMODEM, YMODEM, or ZMODEM.
  756.  
  757.   ###############################
  758.   # log onto MSC BBS (TRIBBS)   #
  759.   # compile with builder, ver 2 #
  760.   ###############################
  761.   #
  762.   # define parameters to use
  763.   #
  764.   USER:     STRING "GUEST GUEST!"
  765.   PASSWORD: STRING "GUEST!"
  766.   PROTOCOL: STRING "Z"
  767.   PHONE:    STRING "1,205,880,9748!"
  768.   #
  769.   # Dial phone
  770.   #
  771.     SETPACE  0.2
  772.     SETWAIT  2.0
  773.     REPLY   "!AT!"
  774.     WAITFOR  "OK"
  775.     IFTRUE   DIAL
  776.     SAY      "Expected OK not received"
  777.     GOTO     ERROR
  778.   DIAL:
  779.     SETWAIT  45.0
  780.     REPLY    "ATDT"
  781.     REPLY    PHONE
  782.     WAITFOR  "CONNECT"
  783.     IFTRUE   LOGIN
  784.     SAY      "Expected CONNECT not found"
  785.     GOTO     ERROR
  786.   #
  787.   # no graphics
  788.   #
  789.   LOGIN:
  790.     SETWAIT  30
  791.     REPLY    CR
  792.     WAITFOR  "graphics (y/N)?"
  793.     IFFALSE  ERROR
  794.     REPLY    CR
  795.   #
  796.   # enter name
  797.   #
  798.     WAITFOR  "FIRST and LAST name:"
  799.     IFFALSE  ERROR
  800.     REPLY    USER
  801.   #
  802.   # enter password
  803.   #
  804.     WAITFOR  "password:"
  805.     IFFALSE  ERROR
  806.     REPLY    PASSWORD
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  SCRIPTS Users Manual                                              Page 12
  817.   #
  818.   # "more?" or "Main Menu:"
  819.   #
  820.   MORE:
  821.     WAITFOR  "more?|Main Menu:"
  822.     IF       "1" THEN SKIP_MAIN
  823.     IFNOT    "0" THEN ERROR
  824.     REPLY    CR
  825.     GOTO     MORE
  826.   SKIP_MAIN:
  827.     REPLY    CR
  828.   #
  829.   # select Files
  830.   #
  831.     WAITFOR  PROMPT
  832.     IFFALSE  ERROR
  833.     REPLY    "F"
  834.   #
  835.   # select Change
  836.   #
  837.     WAITFOR  PROMPT
  838.     IFFALSE  ERROR
  839.     REPLY    "C"
  840.   #
  841.   # select file area 5
  842.   #
  843.     WAITFOR  "file area:"
  844.     IFFALSE  ERROR
  845.     REPLY    "5!"
  846.   #
  847.   # select Download
  848.   #
  849.     WAITFOR  PROMPT
  850.     IFFALSE  ERROR
  851.     REPLY    "D"
  852.     WAITFOR  "download:"
  853.     IFFALSE  ERROR
  854.     REPLY    "BUGS.DOC!"
  855.     WAITFOR  "download:"
  856.     IFFALSE  ERROR
  857.     REPLY    CR
  858.   #
  859.   # select protocol
  860.   #
  861.     WAITFOR  "protocol:"
  862.     IFFALSE  ERROR
  863.     REPLY    PROTOCOL
  864.     REPLY    CR
  865.     WAITFOR  "to continue:"
  866.     IFFALSE  ERROR
  867.     REPLY    CR
  868.   #
  869.   # download BUGS.DOC
  870.   #
  871.     DELAY    0.25
  872.     PROTOCOL PROTOCOL
  873.     RECEIVE  "BUGS.DOC!"
  874.     SAY      "Download complete"
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  SCRIPTS Users Manual                                              Page 13
  885.   #
  886.   # say goodbye
  887.   #
  888.     QUIET    0.5
  889.     REPLY    CR
  890.     WAITFOR  PROMPT
  891.     IFFALSE  ERROR
  892.     REPLY    "G!"
  893.     SAY      "Hanging up..."
  894.     REPLY    CR
  895.     HALT
  896.   #
  897.   # error exit
  898.   #
  899.    ERROR: SAY " "
  900.     SAY "Error !"
  901.     STATUS
  902.     HALT
  903.   #
  904.   # common strings
  905.   #
  906.   PROMPT: STRING  "?]?"
  907.   CR:     STRING  "!"
  908.   #
  909.     END
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  SCRIPTS Users Manual                                              Page 14
  953.